package com.ruoyi.parkinglot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.parkinglot.domain.ParkRoad;
import com.ruoyi.parkinglot.mapper.ParkRoadMapper;
import com.ruoyi.parkinglot.service.ParkRoadService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 31713
* @description 针对表【park_road(道路表 - 用于管理道路基础信息)】的数据库操作Service实现
* @createDate 2025-02-11 13:43:45
*/
@Service
public class ParkRoadServiceImpl extends ServiceImpl<ParkRoadMapper, ParkRoad>
    implements ParkRoadService {

    @Override
    public ParkRoad getRoadById(Long roadId) {
        return getById(roadId);
    }

    @Override
    public List<ParkRoad> selectRoadListByArea() {
        LambdaQueryWrapper<ParkRoad> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ParkRoad::getDelFlag, "0")  // 未删除
                .eq(ParkRoad::getStatus, "0")    // 假设 0 表示正常状态
                .orderByAsc(ParkRoad::getAreaId);

        return baseMapper.selectList(queryWrapper);}
}




